import java.util.Random;

public class Main {
    public static Random rand = new Random();
    public static long seedLCG;//
    public static void main(String[] args) {
        long a = 69069;
        long c = 5;
        long m = 4294967295L;
        Random rand = new Random();
        seedLCG = rand.nextLong(m) + 1;
        //生成前10个伪随机数序列
        for (int i = 0; i < 10; i++) {
            System.out.print(randLCG(a, c, m) + " ");
        }
        System.out.println();

        long max = 100;
        for (int i = 0; i < 10; i++) {
            System.out.print(rangLCG(a, c, m, max) + " ");
        }
        System.out.println();
    }

    public static long randLCG(long a, long c, long m) {

        seedLCG = (a * seedLCG + c) % m;
        return seedLCG;
    }

    public static long rangLCG(long a, long c, long m, long max) {
        seedLCG = (a * seedLCG + c) % m;
        return seedLCG % max;
    }
}
